#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
sys.path.append('../../')

from service.BrainStateService import BrainStateService
from models.brain_state_models import BrainWaveRatesInput

# 创建服务实例并启用调试模式
service = BrainStateService()
service._debug_mode = True

# 创建测试数据（典型放松状态）
print("=== 测试放松状态数据 ===")
print("Delta: 0.12, Theta: 0.18, Low_Alpha: 0.25, High_Alpha: 0.20")
print("Low_Beta: 0.12, High_Beta: 0.08, Low_Gamma: 0.03, Mid_Gamma: 0.02")
print()

input_data = BrainWaveRatesInput(
    session_id='debug_test',
    start_time='2024-01-01T00:00:00Z',
    end_time='2024-01-01T00:01:00Z',
    relative_rates={
        'delta': [0.12],
        'theta': [0.18],
        'low_alpha': [0.25],
        'high_alpha': [0.20],
        'low_beta': [0.12],
        'high_beta': [0.08],
        'low_gamma': [0.03],
        'mid_gamma': [0.02]
    }
)

# 执行分类
result = service.classify_brain_state(input_data)

print(f"\n=== 最终分类结果 ===")
print(f"状态: {result.state}")
print(f"置信度: {result.confidence:.4f}")
print(f"详细信息: {result.details}")